﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using SqlSugar;

namespace Admin.NET.Application.Entity;

/// <summary>
/// 资讯表实体类
/// </summary>
[SugarTable("base_news", "资讯表实体类")]
public class NewsEntity : EntityBase
{

    /// <summary>
    /// 获取或设置资讯标题。
    /// </summary>
    [SugarColumn(ColumnDescription = "资讯标题", Length = 200, IsNullable = false)]
    public string Title { get; set; }

    /// <summary>
    /// 获取或设置资讯副标题或简短描述。
    /// </summary>
    [SugarColumn(ColumnDescription = "副标题", Length = 300, IsNullable = true)]
    public string SubTitle { get; set; }

    /// <summary>
    /// 获取或设置资讯内容正文。
    /// </summary>
    [SugarColumn(ColumnDescription = "资讯内容", ColumnDataType ="text",  IsNullable = true)]
    public string Content { get; set; }

    /// <summary>
    /// 获取或设置资讯分类，例如“行业动态”、“政策解读”、“本地新闻”等。
    /// </summary>
    [SugarColumn(ColumnDescription = "分类", Length = 100, IsNullable = true)]
    public string Category { get; set; }

    /// <summary>
    /// 获取或设置封面图片地址（URL）。
    /// </summary>
    [SugarColumn(ColumnDescription = "封面图地址", Length = 300, IsNullable = true)]
    public string Cover { get; set; }

    /// <summary>
    /// 获取或设置资讯来源，例如“本站原创”、“转载自XX网站”。
    /// </summary>
    [SugarColumn(ColumnDescription = "来源", Length = 200, IsNullable = true)]
    public string Source { get; set; }

    /// <summary>
    /// 获取或设置作者名称。
    /// </summary>
    [SugarColumn(ColumnDescription = "作者", Length = 100, IsNullable = true)]
    public string Author { get; set; }

    /// <summary>
    /// 获取或设置发布时间，默认为当前时间。
    /// </summary>
    [SugarColumn(ColumnDescription = "发布时间", IsNullable = true)]
    public DateTime PublishTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 获取或设置是否置顶。
    /// </summary>
    [SugarColumn(ColumnDescription = "是否置顶")]
    public bool IsPinned { get; set; } = false;

    /// <summary>
    /// 获取或设置浏览次数。
    /// </summary>
    [SugarColumn(ColumnDescription = "浏览次数")]
    public int ViewCount { get; set; } = 0;

    /// <summary>
    /// 获取或设置点赞数。
    /// </summary>
    [SugarColumn(ColumnDescription = "点赞数")]
    public int LikeCount { get; set; } = 0;

    /// <summary>
    /// 获取或设置摘要内容，用于列表展示时显示简介。
    /// </summary>
    [SugarColumn(ColumnDescription = "摘要", Length = 500, IsNullable = true)]
    public string Summary { get; set; }

    /// <summary>
    /// 是否启用
    /// </summary>
    [SugarColumn(ColumnDescription = "是否启用",  IsNullable = true)]
    public bool? IsEnabled { get;   set; }
}
